<template>
    <div class="block">
<!--      {{this.$store.state.id}}-->
<!--      {{this.interviewSeekerData.interviewSeeker}}-->
<!--      求职者ID ID={{interviewSeeker}}-->
      <el-table :data="tableData" stripe border class="seeker_table">
<!--          style="width: 90%"-->
        <el-table-column
            prop="interviewId"
            label="面试编号"
            width="80">
        </el-table-column>
        <el-table-column label="面试时间">
          <el-table-column
            prop="interviewDate"
            label="日期"
            width="150">
          </el-table-column>
          <el-table-column
            prop="interviewTime"
            label="时间"
            width="150">
          </el-table-column>
        </el-table-column>
        <el-table-column
            prop="interviewLocation"
            label="地址"
            width="400">
        </el-table-column>
        <el-table-column
            prop="enterpriseName"
            label="企业"
            width="170">
        </el-table-column>
        <el-table-column
            prop="occupationName"
            label="求职职位"
            width="150">
        </el-table-column>
        <el-table-column
            fixed="right"
            label="操作"
            width="150">
          <template slot-scope="scope">
            <el-button  @click="deleteView(scope.row)" type="primary" icon="el-icon-delete">放弃此面试</el-button>
          </template>
        </el-table-column>
      </el-table>
    </div>
</template>

<script>
export default {


  data() {
    return {
      tableData: [],
      //引用全局id
      interviewSeekerData:{
        interviewSeeker:''
      }
    }
  },

  methods: {
    deleteView(interview){
      // alert(interview.interviewId)
      this.$axios.post('/interview/deleteById?interviewId='+interview.interviewId).then(resp=>{
        if (resp.data.code>-1){
          this.$message({
            showClose: true,
            message: '取消面试成功',
            type: 'success'
          });
        }
        window.location.reload();
        // this.$parent.reload()
      })
    }
  },

  mounted() {
    this.$axios.post('/interview/bySeeker', this.interviewSeekerData).then((resp) => {
      this.tableData = resp.data
    })
  },

  created() {
    this.interviewSeekerData.interviewSeeker = this.$store.state.id
  }
}
</script>

<style scoped>
.seeker_table{
  width: 1400px;
}
.block {
  padding: 20px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 12px 0 rgba(0,0,0,0.1);
}
</style>
